import axios from 'axios'
import {message} from 'antd'
axios.defaults.baseURL = 'http://1.15.222.28:4002'
axios.interceptors.request.use(config => {
    const token = localStorage.token
    if (token) {
        config.headers.Authorization = token
    }
    return config
})
axios.interceptors.response.use((res) => {
    // 响应成功时执行的函数
    return res
}, (err) => {
    // 响应失败执行的函数
    if (err && err.response && err.response.status) {
        if (err.response.status === 401) {
           console.log('jjj');
        }
    }
    return Promise.reject(err.message)
}
)